package org.sundatagroup.aurora.monitor.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.sundatagroup.aurora.monitor.controller.MonitorEndPoint;

/**
 * <p>向系统注册所有 WebSocket 终端 (监控区部分),
 * 以及前端进行访问时配置的路径.
 * </p>
 * 
 * @author Zdream
 * @date 2018-05-17
 * @since 0.2.0
 */
@Configuration
@EnableWebSocket
public class MonitorEndPointRegister implements WebSocketConfigurer {
	
	@Autowired
	MonitorEndPoint monitor;

	/**
	 * 向系统注册 WebSocket 终端, 以及前端进行访问时配置的路径.
	 */
	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		registry.addHandler(monitor, "/aurora/monitor");
	}
}
